cmake_minimum_required(VERSION 3.12)
project(forwarder)

set(CMAKE_CXX_STANDARD 14)

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(triple arm-linux-gnueabihf)
set(CMAKE_C_COMPILER_TARGET ${triple})
set(CMAKE_CXX_COMPILER_TARGET ${triple})
set(CMAKE_C_COMPILER clang)
set(CMAKE_CXX_COMPILER clang++)

set(CMAKE_VERBOSE_MAKEFILE ON)

link_libraries(boost_filesystem-mt boost_system-mt boost_thread-mt boost_log_setup-mt boost_log-mt ws2_32 mswsock)

set(OUTPUT_PATH ${PROJECT_SOURCE_DIR}/build)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_PATH}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_PATH}/bin)

message(STATUS ${CMAKE_HOST_SYSTEM_NAME})
message(STATUS ${CMAKE_SYSTEM_NAME})
message(STATUS ${CMAKE_CROSSCOMPILING})

add_compile_definitions(BOOST_ALL_DYN_LINK)

add_executable(forwarder main.cpp)

add_custom_command(TARGET forwarder
        POST_BUILD
        COMMAND C:/msys64/usr/bin/cp.exe -fr ./config.json ./build/bin/
        WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})

